home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
tifreadr.sit
/
Tiff Window DEMO
/
activate.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-20
|
1KB
|
42 lines
#include "my color.h"
do_activate(an_event)
EventRecord *an_event;
{
CWindowPeek peek;
ControlHandle control;
peek = (CWindowPeek)an_event->message;
if (an_event->modifiers & 01)
{ /*application window is becoming active*/
SetPort((CGrafPtr)an_event->message);
SelectWindow((CWindowPtr)an_event->message);
EnableItem (myMenus[fileM],closeItem);
DisableItem(myMenus[editM],undoItem);
control = peek->controlList;
while(control)
{
ShowControl(control);
control = (*control)->nextControl;
}
DrawGrowIcon((CWindowPtr)an_event->message);
} /*if an_event->modifiers*/
else /*application window is becoming inactive*/
{
if (((CWindowPeek)FrontWindow())->windowKind > 0)
{
control = peek->controlList;
while(control)
{
HideControl(control);
control = (*control)->nextControl;
}
DrawGrowIcon((CWindowPtr)an_event->message);
EnableItem (myMenus[editM], undoItem);
scrapErr = ZeroScrap();
}/*if WindowPeek*/
else
DisableItem (myMenus[editM], undoItem);
} /*else*/
}